package Demo06.Demo05;

import java.io.File;
import java.io.IOException;

public class Demo06_Test1 {
    public static void main(String[] args) {
        File file = new File("G:\\myFiles");
        if (!file.exists()){
            file.mkdir();
        }
        for (int i = 1; i <=3 ; i++) {
            File file1 = new File(file, "info" + i + ".txt");
            try {
                file1.createNewFile();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        File[] files = file.listFiles();
        for (File file1 :files){
            System.out.println(file1);
        }
    }
}
